package xyz.eden.boot.common.web.support.infrastructure.gateway.base.converter;


import xyz.eden.boot.common.web.support.domain.gateway.bo.BaseInfoBO;
import xyz.eden.boot.common.web.support.infrastructure.resource.db.po.BasePO;

import java.util.Objects;

/**
 * BaseConverter
 *
 * @author gavin
 * @version 1.0
 * @descriptor
 * @date 2023/4/29 16:57
 */
public class BaseConverter {

    protected static <P extends BasePO, B extends BaseInfoBO> void builderBaseInfo(B b, P p) {
        if (Objects.nonNull(b) && Objects.nonNull(p)) {
            b.setId(p.getId());
            b.setStatus(p.getStatus());
            b.setCreateTime(p.getCreateTime());
            b.setCreateMisCode(p.getCreateMisCode());
            b.setUpdateTime(p.getUpdateTime());
            b.setUpdateMisCode(p.getUpdateMisCode());
        }
    }
}
